package com.kclm.xsap.dto.convert;

import com.kclm.xsap.dto.EmployeeDTO;
import com.kclm.xsap.dto.UserDTO;
import com.kclm.xsap.entity.Employee;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @Author : lvhx
 * @Date: 2025/6/20 10:42
 * @Description:
 */
@Mapper(componentModel = "spring")
public interface UserConvert {
    @Mappings({
            @Mapping(source = "id", target = "id"),//??没有id?
            @Mapping(source = "name",target = "realName"),
            @Mapping(source = "avatarUrl",target = "avatarUrl"),
            @Mapping(source = "phone",target = "tel"),
            @Mapping(source = "roleName",target = "userName"),
            @Mapping(source = "sex",target = "gender"),
            @Mapping(source = "createTime",target = "registerTime"),
            @Mapping(source = "lastModifyTime",target = "lastLoginTime"),
    })
    UserDTO toDTO(Employee employee);

}
